
<!DOCTYPE html>
<html>  
<head>
<title>欢乐送</title>

 

<!-- Custom Theme files -->
<link href="__PUBLIC__/assets_h/csslogin/style.css" rel="stylesheet" type="text/css" media="all"/>



    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
  <include file="Public/header"/>
</head>
              
<body>            
 <div class="login">
  
  <div class="login-top">
       
       <h1>注册 </h1>
            <form method="post"  class="form-horizontal" action="{:U(upload)}" enctype="multipart/form-data" onsubmit="return sendRequest();">
     

                  <div class="form-group">
                    <label for="inputname" class="col-md-3 control-label">手机号:</label>
                      <div class="col-md-9">
                      <input class="form-control" placeholder="手机号" type="telephone" id="tel" required pattern="[0-9]{11}" name="tel" onblur="checkTele()">
                      <span id="tip" style="color:red"></span>
                      </div>
                  </div>
                 
                  <div class="form-group">
                    <label for="inputname" class="col-md-3 control-label">用户别名:</label>
                      <div class="col-md-9">
                      <input class="form-control" placeholder="用户别名" type="text" id="username" name="username" onblur="checkName()">
                      <span id="nametip" style="color:red"></span>
                      </div>
                  </div>

                   <div class="form-group">
                    <label for="inputname" class="col-md-3 control-label">邮箱:</label>
                      <div class="col-md-9">
                      <input class="form-control" placeholder="邮箱" type="email" id="email" name="email" >
                      </div>
                  </div>
  
                  <div class="form-group">
                    <label for="inputname" class="col-md-3 control-label">密码:</label>
                      <div class="col-md-9">
                      <input class="form-control"  type="password" id="password" name="password" required>
                      </div>
                  </div>
                  <div class="form-group">
                    <label for="inputname" class="col-md-3 control-label">确认密码:</label>
                      <div class="col-md-9">
                      <input class="form-control"  type="password" id="newpassword" name="newpassword" required>
                      </div>
                  </div>
                  
                  <div class="form-group">
                    <label for="inputname" class="col-md-3 control-label">头像:</label>
                      <div class="fileupload fileupload-new" data-provides="fileupload">
                      <input type="hidden" value="" name="" >
                          <div class="fileupload-new img-thumbnail"style="width: 110px; height: 110px;background-color:#FFFFFF">
                      <img src="">
                          </div>
                          <div class="fileupload-preview fileupload-exists img-thumbnail"
                               style="width: 110px; max-height: 110px;"></div>
                          
                    <span class="btn btn-default btn-file">   
                        <span class="fileupload-new">选择头像</span>
                        <span class="fileupload-exists">重选</span><input type="file" name="photo" >
                        </span>
                          <span>
                        <a class="btn btn-default fileupload-exists" data-dismiss="fileupload"
                                  href="#">撤销</a>
                        </span>
                      </div>
                      </div>

                        <div class="form-group">
                          <div class="col-md-6">
                            <input class="btn btn-block btn-info "  type="submit" value="注 册">
                          </div>
                          <div class="col-md-6">
                            <input class="btn btn-block btn-info"  type="reset" value="重 置">
                          </div> 
                    
                          </div>
                  </form>
             </div>
          </div>
     
<include file="Public:footer" />
</div>    
    </div>
  </body>

 <script>
        function check(){
            var password = document.getElementById("password").value;
            var repsword = document.getElementById("newpassword").value;
        if(password == ''||repsword==''){
        alert('密码不能为空');
            return false;
        }
        if(password != repsword) {
        alert("两次密码不同，请重新输入");
            return false;
        }
       return true;
        }
    </script>
    <script>
      function checkTele(){
        
    var xmlHttp;
      try{    // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();    
          }
  catch(e){   // Internet Explorer
          try{
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
              }
  catch (e){
          try{
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
  catch (e){
              alert("您的浏览器不支持AJAX！");
              return false;
            }      
          }    
        }  //打开连接
       var tele = document.getElementById("tel").value;
       xmlHttp.open("GET", "checkTele?t="+tele, true);
       xmlHttp.send();
     //指定响应式处理
      xmlHttp.onreadystatechange=function() {
      if (xmlHttp.readyState==4 && xmlHttp.status==200)
        { 
          document.getElementById("tip").innerHTML=xmlHttp.responseText;
         }
      }
     } 

      function checkName(){
        //alert("呵呵");
        var xmlHttp;
      try{    // Firefox, Opera 8.0+, Safari
          xmlHttp=new XMLHttpRequest();    
          }
  catch(e){   // Internet Explorer
          try{
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
              }
  catch (e){
          try{
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
  catch (e){
              alert("您的浏览器不支持AJAX！");
              return false;
            }      
          }    
        } 
       var name = document.getElementById("username").value;
       xmlHttp.open("GET", "checkName?n="+name, true);
       xmlHttp.send();

      xmlHttp.onreadystatechange=function() {
      if (xmlHttp.readyState==4 && xmlHttp.status==200)
        { 
          document.getElementById("nametip").innerHTML=xmlHttp.responseText;
         }
      }
     }
 

</script>

</html>